package stdio.costa.utils;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

import net.coobird.thumbnailator.Thumbnails;

public class ImageUtils {
	
	public static byte[] zoom(byte[] original, int width, int height) throws IOException {
		ByteArrayInputStream input = new ByteArrayInputStream(original);
		ByteArrayOutputStream output = new ByteArrayOutputStream();
		Thumbnails.of(input).size(width, height).toOutputStream(output);
		return output.toByteArray();
	}
}
